package com.henry.controller.customer;

import com.henry.bean.Customer;
import com.henry.framework.annotation.Action;
import com.henry.framework.annotation.Controller;
import com.henry.framework.annotation.Inject;
import com.henry.framework.bean.Data;
import com.henry.framework.bean.Param;
import com.henry.framework.bean.View;
import com.henry.service.customer.CustomerService;

import java.util.List;

/**
 * Created by 峥桂 on 2017/5/6.
 */
@Controller
public class CustomerController {

    @Inject
    private CustomerService customerService;

    @Action("get:/customer")
    public View index(Param param){
        List<Customer> customerList=customerService.getCustomerList();
        return new View("customer.jsp").addModel("customerList",customerList);

    }

    @Action("get:/data")
    public Data  showData(Param param){
        List<Customer> customerList=customerService.getCustomerList();
        Data data=new Data(customerList);
        return data;

    }

}
